#include "StdAfx.h"
#include "Exception.h"
#include "SEHException.h"
#include "FunctionObject.h"
#include "StackFrame.h"
#include "StackTrace.h"

SEHException::SEHException(const std::string& type, DWORD dwAddress, LPCONTEXT context) {
	std::stringstream strm;
	strm << "A Win32 fault occurred in the program: " << std::endl;
	strm << "Type: " << type << std::endl;
	strm << "Location: 0x" << std::hex << std::uppercase << dwAddress << std::nouppercase << std::dec << std::endl;
	StackTrace trace(*context);
	strm << trace << std::endl;

	mMessage = strm.str();
}